package ru.niir.goodfil.audit.ui.beans;

import org.richfaces.model.CalendarDataModel;
import org.richfaces.model.CalendarDataModelItem;

import java.util.Date;

public class TestBean {
    private CalendarDataModel model;
    private Date date;

    public TestBean() {
        model = new CalendarDataModel() {
            @Override
            public CalendarDataModelItem[] getData(Date[] dates) {
                CalendarDataModelItem[] result = new CalendarDataModelItem[dates.length];
                for (int i = 0; i < dates.length; i++) {
                    Date date = dates[i];
                    result[i] = new CalendarDataModelItem() {
                        @Override
                        public boolean isEnabled() {
                            return false;
                        }

                        @Override
                        public String getStyleClass() {
                            return "red";
                        }

                        @Override
                        public Object getData() {
                            return null;  //To change body of implemented methods use File | Settings | File Templates.
                        }

                        @Override
                        public boolean hasToolTip() {
                            return false;  //To change body of implemented methods use File | Settings | File Templates.
                        }

                        @Override
                        public Object getToolTip() {
                            return null;  //To change body of implemented methods use File | Settings | File Templates.
                        }

                        @Override
                        public int getDay() {
                            return 0;  //To change body of implemented methods use File | Settings | File Templates.
                        }
                    };
                }
                return result;
            }

            @Override
            public Object getToolTip(Date date) {
                return "Hello world";
            }
        };
    }

    public CalendarDataModel getModel() {
        return model;
    }

    public void setModel(CalendarDataModel model) {
        this.model = model;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}
